/**
 * Copyright (C), 2015-2024, XXX有限公司
 * FileName: Main
 * Author:   Administrator
 * Date:     2024/3/23 15:20
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */

/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Administrator
 * @create 2024/3/23
 * @since 1.0.0
 */
public class Main {

    public static void main(String[] args) {
        Integer[] arras = {8, 6, 3, 7, 2, 5, 4, 1, 9};

        int[] sort = new int[arras.length];
        for (int i = 0; i < sort.length; i++) {
            int max = 0;
            for (int j = 0; j < arras.length; j++) {
                if (arras[max] < arras[j]) {
                    max = j;
                }
            }
            sort[i] = arras[max];
            arras[max] = 0;
        }
        for (int i = 0; i < sort.length; i++) {
            System.out.print(sort[i] + " ");
        }
    }
}